import React, { lazy } from 'react';

const Login = lazy(() => import('../views/login/Login'));

import Index from '../views/index/Index';


// Navigate 重定向组件
import { Navigate } from 'react-router-dom';

const withLoadingComponent = (comp: JSX.Element) => <React.Suspense fallback={<div>Loading...</div>}>{comp}</React.Suspense>;

const routes = [
  {
    path: '/',
    element: <Index />,
  },
  {
    path: '/login',
    element: withLoadingComponent(<Login />),
  },
  // {
  //   path: '/about',
  //   element: <About />,
  // },
];

export default routes;
